home *** CD-ROM | disk | FTP | other *** search
/ CD ROM Paradise Collection 4 / CD ROM Paradise Collection 4 1995 Nov.iso / program / swagd_f.zip / EGAVGA.SWG / 0173_Set Secondary Page Position.pas < prev    next >
Pascal/Delphi Source File  |  1995-03-03  |  1KB  |  49 lines

  1. {
  2. > What I need to know is how I can use that information  as well
  3. > as which registers to use (ax,dx etc) to  write or read from a
  4. > specific field of a register without affecting other fields.
  5.  
  6. Well, get a VGADOC, number three is the latest: VGADOC3.???. Then you know
  7. which ports can do what..Secondly: get my graphics package (for instance),
  8. called GFXFX.???, in which you can see how to play with these ports
  9. }
  10.  
  11. procedure setlinecomp(ad:word); assembler;
  12. asm
  13.   mov dx,3d4h
  14.   mov al,18h
  15.   mov ah,[byte(ad)]
  16.   out dx,ax
  17.   mov al,7
  18.   out dx,al
  19.   inc dx
  20.   in al,dx
  21.   dec dx
  22.   mov ah,[byte(ad)+1]
  23.   and ah,00000001b
  24.   shl ah,4
  25.   and al,11101111b
  26.   or al,ah
  27.   mov ah,al
  28.   mov al,7
  29.   out dx,ax
  30.  
  31.   mov al,9
  32.   out dx,al
  33.   inc dx
  34.   in al,dx
  35.   dec dx
  36.   mov ah,[byte(ad)+1]
  37.   and ah,00000010b
  38.   shl ah,5
  39.   and al,10111111b
  40.   or al,ah
  41.   mov ah,al
  42.   mov al,9
  43.   out dx,ax
  44. end;
  45. {
  46. These procedure sets the position of the secondary page. Try it out. As far
  47. as I know it should work in every mode, not only mode-x, though it was
  48. designed
  49. }